package genetic.treevisualizer;

import java.awt.*;

public class METreeBranchRenderer implements TreeBranchRenderer{

	public Color getBranchColor(Object node, int level) {
		String name = node.getClass().getName();
		Color out = Color.black;
		if (name.equals("genetic.treenodes.Addition")) {out = new Color(0, 0, 180);}
		if (name.equals("genetic.treenodes.Subtraction")) {out = new Color(0, 0, 255);}
		if (name.equals("genetic.treenodes.Multiplication")) {out = new Color(70, 70, 255);}
		if (name.equals("genetic.treenodes.Division")) {out = new Color(140, 140, 255);}
		
		if (name.equals("genetic.treenodes.Sinus")) {out = new Color(200, 0, 0);}
		
		if (name.equals("genetic.treenodes.IfEqualThenElse")) {out = new Color(0, 128, 0);}
		if (name.equals("genetic.treenodes.IfGreaterThenElse")) {out = new Color(0, 200, 0);}
		
		return out;
	}
	
	//Retitle this "getBranchColor" and the above function "getBranchColor2"
	//to make this one active
	public Color getBranchColor2(Object node, int level) {
		String name = node.getClass().getName();
		Color out = Color.black;
		if (name.equals("NodeNumIF")) {out = new Color(255, 255, 0);}
		if (name.equals("NodeNumAdd")) {out = new Color(171, 171, 0);}
		if (name.equals("NodeNumSubtract")) {out = new Color(86, 86, 0);}
		
		if (name.equals("NodeBoolLessThan")) {out = new Color(0, 0, 85);}
		if (name.equals("NodeBoolGreaterThan")) {out = new Color(0, 0, 171);}
		if (name.equals("NodeBoolEquals")) {out = new Color(0, 0, 255);}
		
		if (name.equals("NodeBoolOR")) {out = new Color(200, 200, 200);}
		if (name.equals("NodeBoolXOR")) {out = new Color(150, 150, 150);}
		if (name.equals("NodeBoolAND")) {out = new Color(100, 100, 100);}
		if (name.equals("NodeBoolIF")) {out = new Color(250, 250, 250);}
		if (name.equals("NodeBoolNOT")) {out = new Color(50, 50, 50);}
		return out;
	}

}
